import 'package:ty_smart_watch/bean/base_data_bean.dart';
import 'package:ty_smart_watch/bean/gps_bean.dart';
import 'package:ty_smart_watch/bean/sport_recorder_bean.dart';

import 'alarm_bean.dart';

class ReceiveDataBean {
  int currFrame;
  int totalFrame;
  int functionFlag;
  int checkSum;
  int packageLength;
  int functionId;
  int dataLength;


  ReceiveDataBean(this.currFrame, this.totalFrame, this.functionFlag, this.checkSum,
      this.packageLength, this.functionId, this.dataLength);

  Map<String, int> dataLongMap = {};
  Map<String, String> dataStringMap = {};
  Map<String, List<int>> dataIntListMap = {};
  Map<String, List<BaseDataBean>> dataBaseDataListMap = {};
  Map<String, List<GpsBean>> dataGpsDataListMap = {};
  Map<String, List<AlarmBean>> dataAlarmMap = {};
  List<SportBean> sportDataList = [];

  void setLongData(String key, int value) {
    dataLongMap[key] = value;
  }

  void setStringData(String key, String value) {
    dataStringMap[key] = value;
  }

  void setIntListData(String key, List<int> value) {
    dataIntListMap[key] = value;
  }

  void setBaseDataListData(String key, List<BaseDataBean> value) {
    dataBaseDataListMap[key] = value;
  }

  void setGpsListData(String key, List<GpsBean> value) {
    dataGpsDataListMap[key] = value;
  }

  void setAlarmData(String key, List<AlarmBean> value) {
    dataAlarmMap[key] = value;
  }

  void setSportDataList(List<SportBean> list) {
    sportDataList.clear();
    sportDataList.addAll(list);
  }

  @override
  String toString() {
    return 'ReceiveDataBean{currFrame: $currFrame, totalFrame: $totalFrame, functionFlag: $functionFlag, checkSum: $checkSum, packageLength: $packageLength, functionId: $functionId, dataLength: $dataLength, dataLongMap: $dataLongMap, dataStringMap: $dataStringMap, dataIntListMap: $dataIntListMap, dataBaseDataListMap: ${dataBaseDataListMap.toString()}, dataGpsDataListMap: $dataGpsDataListMap, dataAlarmMap: $dataAlarmMap, sportDataList: $sportDataList}';
  }
}
